$(".openMaterialDraggable").on("mouseover", ".material-preview", function () {
    $(this).children('.operation-btns').show();
    $(this).children('.del-wrap').children('.icon-close').show();
}).on("mouseout", ".material-preview", function () {
    $(this).children('.operation-btns').hide();
    $(this).children('.del-wrap').children('.icon-close').hide();
}).on('click', '.icon-close', function () {
   // $(this).parent().parent().remove();
   var i = $(this).index('.uploadDels'),n = $(".openMaterial").attr('data-name');
   var value = $("#uploadimage_"+n).val().split(',');
   $.each(value,function(index,item){
       if(i==index){
           $('.openMaterialDraggable .material-preview:eq(' + i + ')').remove();
           value.splice(index,1);
       }
   })
   $("#uploadimage_"+n).val(value.join(','));//重新赋值

}).on('click', '.openMaterialPreview', function () {
    var value = $(this).attr("data-url").split(',');
    var data = [];
    for (i in value) {
        data.push({src: value[i]});
    }
    layer.photos({
        photos: {"data": data, "start": 0}
        , anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机
        , closeBtn: 1,
    });
})